/**
 * Created by asus on 2016/11/23.
 */
import React, { Component} from 'react';

export default class Top extends Component {
    onClick(){
        window.history.back()
    }

    render(){
        const {title,bgColor} = this.props
        let style = {};
        if(!bgColor){
            style = {backgroundColor:'#fa6b5b'}
        }else{
            style = bgColor
        }
        return(
            <div className="flex width100 flex-align-center flex-pack-center f20 colorfff h50 pf top0 z999" style={style}>
                {title}
                <div
                    onClick={()=>this.onClick()}
                    className="pa f24"
                    style={{top:6,left:'1rem'}}>
                    <span className="di" style={{width:52,height:15,lineHeight:0}}>
                        <img src={require('../../Images/common/leftArrow.png')} alt=""/>
                    </span>
                </div>
            </div>
        )
    }

}